cmake_minimum_required(VERSION 2.8.3)
project(iiwa14_NMPC)
# --- set compiler flags for pinocchio ---
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -DPINOCCHIO_WITH_URDFDOM -DPINOCCHIO_WITH_HPP_FCL -DHPP_FCL_HAS_OCTOMAP -DHPP_FCL_HAVE_OCTOMAP -DFCL_HAVE_OCTOMAP -DOCTOMAP_MAJOR_VERSION=1 -DOCTOMAP_MINOR_VERSION=9 -DOCTOMAP_PATCH_VERSION=6 -I/opt/openrobots/include -I/usr/include/eigen3 -L/opt/openrobots/lib -Wl,-rpath,/opt/openrobots/lib -lpinocchio -Wl,-rpath,/usr/lib/x86_64-linux-gnu -lboost_filesystem -lboost_serialization -lboost_system -lurdfdom_sensor -lurdfdom_model_state -lurdfdom_model -lurdfdom_world -lconsole_bridge -Wl,-rpath,/opt/openrobots/lib -lhpp-fcl -loctomap -loctomath -fopenmp -O3")
# --- add definitions for vrep ---
# add_definitions(-DNON_MATLAB_PARSING -DMAX_EXT_API_CONNECTIONS=255 -DDO_NOT_USE_SHARED_MEMORY)
# --- set the directory where the generated executables are placed ---
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin)
# --- set the directory where the generated libraries are placed ---
set(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/lib)

find_package(pinocchio REQUIRED)

# --- find eigens ---
find_package(Eigen3 REQUIRED)
include_directories(${EIGEN3_INCLUDE_DIR})
add_definitions(${EIGEN_DEFINITIONS})
# --- find boost_system ---
find_package(Boost REQUIRED COMPONENTS system)
# --- add pinocchio header files directory ---
include_directories(/opt/openrobots/include/)


# --- set iiwa14 dynamics source files directory ---
set(IIWA14_DYNAMICS_DIR ${CMAKE_SOURCE_DIR})


include_directories(${IIWA14_DYNAMICS_DIR})
# --- add library directory ---
link_directories(${CMAKE_SOURCE_DIR}/lib)


# --- generate iiwa14 dynamics library ---
#add_library(iiwa14_dynamics SHARED ${IIWA14_DYNAMICS_DIR}/overview-urdf.cpp) 
#target_link_libraries(iiwa14_dynamics urdfdom_model)
# --- generate executable ---
add_executable(${PROJECT_NAME} overview-urdf.cpp)
target_link_libraries(${PROJECT_NAME} boost_system gomp pthread pinocchio) #remoteApi 

